package cn.zxf.note.note.stats;

import cn.zxf.note.common.web.AbstractController;
import cn.zxf.note.note.stats.dto.StatsDayDto;
import cn.zxf.note.note.stats.dto.TotalStatsDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.server.ServerWebExchange;

import java.util.List;

/**
 * Created by zengxf on 2019/9/6.
 */
@RestController
@RequestMapping("/api/note/stats")
public class NoteStatsController extends AbstractController {

    @Autowired
    private NoteStatsService service;

    @GetMapping("stats-total")
    public List<TotalStatsDto> statsTotal(ServerWebExchange ex) {
        return service.statsTotal(super.curUserId(ex));
    }

    @GetMapping("stats-every-day")
    public List<StatsDayDto> statsEveryDay(ServerWebExchange ex) {
        return service.statsEveryDay(super.curUserId(ex));
    }

}
